/* C Program to Count Number of Digits in a Number using While Loop */
#include <stdio.h>
int main()
{
int Number, Reminder, Count=0;
printf("\n Please Enter any number\n");
scanf("%d", &Number);
while(Number > 0)
{
Number = Number / 10;
Count = Count + 1;
}
printf("\n Number of Digits in a Given Number = %d", Count);
return 0;
}
#include <stdio.h>
int main(){
int num = 1024;
while(num != 0){
int digit = num % 10;
num = num / 10;
printf("%d\n", digit);
}
return 0;
}